package com.hgw.Demo08_StatePattern.ShareStatePattern;

/**
 * Data time:2021/12/19 21:16
 * StudentID:2019112118
 * Author:hgw
 * Description: 关闭状态类
 */
public class OffState extends SwitchState{
    @Override
    public void on(Switch s) {
        System.out.println("已经打开！");
        s.setState(Switch.getState("on"));
    }

    @Override
    public void off(Switch s) {
        System.out.println("已经关闭！");
    }
}
